<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="" />
    <meta name="author" content="ChongMing" />
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="full-screen" content="yes">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="360-fullscreen" content="true">
    <title>个人病历</title>
</head>
<link rel="stylesheet" href="../css/framework7.ios.min.css">
<link rel="stylesheet" href="../css/framework7.ios.colors.min.css">
<link rel="stylesheet" href="../css/my-app.css">
<link rel="stylesheet" href="../css/reset.css">
<link rel="stylesheet" href="css/consultation.css">
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.mobile-1.4.3.js"></script>
<script type="text/javascript" src="../js/framework7.min.js"></script>
<script type="text/javascript" src="../js/my-app.js"></script>
<script type="text/javascript" src="js/consultation.js"></script>
<script>
    $(function(){
        consultationinterface.hospital_list2();
        var uid = consultationinterface.getQueryString('uid')
        var treatment_type = 2;
        var hospital_id = '';
        $('.personalrecord .con-top .mode').click(function(){
            $('.medicalrecord-layer').show();
        });
        $('.personalrecord .medicalrecord-layer .con p').click(function(){
            var index = $(this).index();
            var text = $(this).html();
            $('.personalrecord .con-top .mode .p2').html(text);
            $('.personalrecord .medicalrecord-layer').hide();
            treatment_type = index;
        });
        $('.personalrecord .medicalrecord-layer').click(function(){
           $(this).hide();
        });
//        就诊医院
        $('.personalrecord .con-top .hospital').click(function(){
            $('.hospatil-layer').show();
        });
        $(document).on('click','.personalrecord .hospatil-layer .con p',function(){
            var text = $(this).html();
            hospital_id = $(this).attr('data-id');
            $('.personalrecord .con-top .hospital .p2').html(text);
            $('.personalrecord .hospatil-layer').hide();
        });
        $('.personalrecord .hospatil-layer').click(function(){
            $(this).hide();
        });
//        提交病历
        $('.personalrecord .confirm').click(function(){
            var  illness_name = $('.personalrecord .con-bot .illness-name input').val();
            var describe = $('.personalrecord .con-bot .describe textarea').val();
            if(treatment_type==2){
                consultationinterface.layer('请选择就诊方式');
            }else if(hospital_id==''){
                consultationinterface.layer('请选择医院');
            }else if(illness_name==''){
                consultationinterface.layer('请填写疾病名称');
            }else if(describe==''){
                consultationinterface.layer('请填写症状描述');
            }else{
                alert(uid)
                consultationinterface.build_case(uid,treatment_type,hospital_id,illness_name,describe)
            }
        });
    });
</script>
<style>

</style>
<body style=" background: #ebebeb; max-width:640px; margin: auto;-webkit-overflow-scrolling: touch;overflow: scroll;">
<div class="personalrecord">
    <div class="con-top">
        <div class="mode public">
            <p class="p1">就诊方式</p>
            <img src="images/icon7.png">
            <p class="p2">请选择</p>
        </div>
        <div class="hospital public">
            <p class="p1">就诊医院</p>
            <img src="images/icon7.png">
            <p class="p2">选择医院</p>
        </div>
    </div>
    <div class="con-bot">
        <div class="illness-name">
            <p>疾病名称</p>
            <input type="text" placeholder="请填写">
        </div>
        <div class="describe">
            <p>病情/症状描述</p>
            <textarea placeholder="例:最近1个月，感觉腰部疼痛，尤其是在运动的时候，前几天在当地医院做了个检查，结果是腰椎间盘突出......担心之前诊断有问题，希望找位好专家帮确诊并治疗。"></textarea>
        </div>
    </div>
    <button class="confirm">确认</button>
    <div class="medicalrecord-layer">
        <div class="con" style="height: auto">
            <p>面诊</p>
            <p>远程会诊</p>
        </div>
    </div>
    <div class="hospatil-layer">
        <div class="con">
            <p>北京协和医院</p>
            <p>人民医院</p>
        </div>
    </div>
</div>
</body>
</html>